Repository navigation
feat(proxies): CLI proxy workroots -> ~/.local/state/cli-proxies - #2782
Conversation
muse-proxy, commandcode-proxy and claude-code-proxy default their workroot to bin/work inside the ~/code checkout, so every warm session and per-conversation workdir dirties the primary checkout and blocks pm-git-sync. All three scripts already honour a *_PROXY_WORKDIR override; set it on the three home-manager user units to the shared state dir %h/.local/state/cli-proxies (runtime state preserved/moved at deploy time, per Drew 2026-10-29/30 - not a gitignore fix).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Follow-up to #2782: the nine files under bin/work are CLI-proxy runtime state (warm-session map, per-session workdir products) that was committed accidentally and then kept dirtying the primary checkout as the proxies rewrote it live. The proxies now run with their workroots in ~/.local/state/cli-proxies; the on-disk state was copied there and the in-repo residue moved out preserved (never deleted, never gitignored, per Drew 2026-10-29/30). Nothing in the repo references bin/work.
…#3067) The commandcode + claude-code session map was anchored to PROXY_DIR (bin/sessions.json), so the #2782 workdir move to ~/.local/state/cli-proxies missed it and the tracked checkout kept dirtying with every session write, blocking pm-git-sync. - commandcode-proxy: add COMMANDCODE_PROXY_SESSION_FILE override (mirrors claude-code pattern); default resolves to the shared state root sessions.json. - claude-code-proxy: SESSION_FILE default moves from PROXY_DIR to the same shared state-root path; env override kept. Both proxies share one map (mirrored key space) so both must resolve to the same file. - home/common: pin COMMANDCODE_PROXY_SESSION_FILE and CLAUDE_CODE_PROXY_SESSION_FILE to %h/.local/state/cli-proxies/sessions.json on both units, alongside the existing *_PROXY_WORKDIR pins. Codex audit: bin/codex-proxy.mjs already resolves sessions.json via sessionStateDir() = $XDG_STATE_HOME/codex-proxy or ~/.local/state/codex-proxy -- outside the checkout, no change needed. muse-proxy uses warm-sessions.json under WORKDIR (moved by #2782), untouched. No .gitignore entry for bin/sessions.json, by design: after this fix nothing may write there, and dirt in the primary checkout is the regression tripwire. Verified: node --check on both proxies; node --test bin/commandcode-proxy.test.mjs (1 pass) and bin/claude-code-proxy.test.mjs (5 pass); nix-instantiate --parse home/common/default.nix rc=0; default path expression resolves to /home/user/.local/state/cli-proxies/sessions.json.
Problem
muse-proxy, commandcode-proxy and claude-code-proxy all default their workroot to
bin/workinside the~/codecheckout (path.join(PROXY_DIR, 'work')). Muse writeswarm-sessions.json+ prompt files there; CommandCode createssessions/<hash>+acp-project; Claude Code createssessions/<hash>. That runtime state dirties the primary checkout continuously (a trackedwarm-sessions.jsonis rewritten live) and is what blocks pm-git-sync from resuming.Change
All three scripts already honour a
*_PROXY_WORKDIRoverride (MUSE_PROXY_WORKDIR,COMMANDCODE_PROXY_WORKDIR,CLAUDE_CODE_PROXY_WORKDIR). This sets each on its home-manager user unit inhome/common/default.nixto the one shared state dir%h/.local/state/cli-proxies, plus a comment recording why. No script changes; no other units touched.Deploy (post-merge, proxy lane)
~/code/bin/workcontents (128M: warm-session map + session workdirs) into~/.local/state/cli-proxiesBEFORE restarting the services, so warm sessions and existing session work survive.bin/workin a follow-up cleanup PR.Explicitly NOT a .gitignore fix, per Drew's 2026-10-29 call: session dirs can hold real work products - they get preserved/moved, never hidden. Approved by Drew in Repo sweeps 2026-10-30.
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit